[#macro paginate currentPage totalPage actionUrl urlParas=""]
	[#if (totalPage <= 0) || (currentPage > totalPage)] [#return] [/#if]
	[#local startPage = currentPage - 2]
	[#if (startPage < 1)] [#local startPage = 1] [/#if]
	
	[#local endPage = currentPage + 2]
	[#if (endPage > totalPage)] [#local endPage = totalPage] [/#if]
    
	<div id="page">
		<ul class="pagination">
		[#if (currentPage <= 3)]
			[#local startPage = 1]
		[/#if]
		[#if ((totalPage - currentPage) < 2)]
			[#local endPage = totalPage]
		[/#if]
          
		[#if (currentPage == 1)]
				<li class="disabled"><a>首页</a></li>
                <li class="disabled"><a>上页</a></li>
		[#else]
                <li><a href="${ContextPath}${actionUrl}1${urlParas!}">首页</a></li>
                <li><a href="${ContextPath}${actionUrl}#{currentPage - 1}${urlParas!}">上页</a></li>
		[/#if]
          
		[#list startPage..endPage as i]
			[#if currentPage == i]
               <li class="active"><a class="disabled">#{i}</a></li>
            [#else]
               <li><a href="${ContextPath}${actionUrl}#{i}${urlParas!}">#{i}</a></li>
            [/#if]
		[/#list]
          
		[#if (currentPage == totalPage)]
            <li class="disabled"><a>下页</a></li>
            <li class="disabled"><a>尾页</a></li>
		[#else]
            <li><a href="${ContextPath}${actionUrl}#{currentPage + 1}${urlParas!}">下页</a></li>
            <li><a href="${ContextPath}${actionUrl}#{totalPage}${urlParas!}">尾页</a></li>
		[/#if]
        </ul>
   </div>

[/#macro]